import 'package:flutter/cupertino.dart';

class UserNotifier with ChangeNotifier {
  var _isLogin = false;
  var _name;
  var _pageIndex = 0;

  get isLogin => _isLogin;
  get name => _name;
  get pageIndex => _pageIndex;
  set pageIndex(int index) {
    _pageIndex = index;
    notifyListeners();
  }

  login(String name) {
    _isLogin = true;
    _name = name;
    notifyListeners();
  }

  logout() {
    _isLogin = false;
    notifyListeners();
  }
}
